var arr = new Array();
arr=[
    "../img/1.jpg",
    "../img/2.jpg",
    "../img/3.jpg",
    "../img/4.jpg",
    "../img/5.jpg"];
var time,index=0;
function showPic(){
    document.getElementById("img").src=arr[index];
    if(index<arr.length-1){
        index++;
    }else{
        index=0;
    }
}
setInterval("showPic()",100);